// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV
})

const db =  cloud.database()

// 云函数入口函数
exports.main = async (event, context) => {
  const wxContext = cloud.getWXContext()


 // 查询我的动态

  return await db.collection('news').where({
     _openid:wxContext.OPENID
   }).skip(event.start).limit(event.count)
   .orderBy('createTime','desc').get()
   



  // return {
  //   event,
  //   openid: wxContext.OPENID,
  //   appid: wxContext.APPID,
  //   unionid: wxContext.UNIONID,
  // }
}